<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<?php echo $this->Html->charset(); ?>
	<title>
		<?php __('CakePHP: the rapid development php framework:'); ?>
		<?php echo $title_for_layout; ?>
	</title>
	<?php
		echo $this->Html->meta('icon');
		echo $this->Html->css('cake.generic');
		echo $html->css('menu_style');
		echo $scripts_for_layout;
	?>
</head>
<body>
<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', '<?php echo $ganalytics?>']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>
<?php
echo $javascript->link('prototype');
echo $javascript->link('scriptaculous');
?>
	<div id="container">
		<div id="header">
			<h1><?php echo $this->Html->link(__('cBBweb', true), array('controller' => 'pages', 'action' => 'display', 'home')); ?></h1>
		<form id="SelectChampionship" method="post" action="">
		<fieldset style="display:none;"><input type="hidden" name="_method" value="POST" /></fieldset>
		<fieldset>
		<select name="data[AppController][Championship]" disable="disable" onchange="this.form.submit();" id="select_championship">
		<option value="">Select a Championship</option>
		<?php

foreach ($championships_list as $key => $value) {
	if ($current_championship == $key) {
		$selected = 'selected';
	} else {
		$selected = '';
	}
	echo '<option ' . $selected . ' value="' . $key . '" >' . $value . '</option>';
}
?>
		</select>
		</fieldset>
		</form>
	</div>
	<div id="content">
<div class="menu">
<ul>
	<li>
	<?php
		if (isset ($user)) {
			$tmp = $user;
		} else {
			$tmp = 'User';
		}
		echo $html->link($tmp, array (
			'controller' => 'users',
			'action' => 'index'
		));
	?>
	<ul>
	<li><?php
		if (isset ($user)) {
			echo $html->link(__('Logout', true), array (
				'controller' => 'users',
				'action' => 'logout'
			));
		} else {
			echo $html->link(__('Login', true), array (
				'controller' => 'users',
				'action' => 'login'
			));
		}
	?>
	</li>
	</ul>
	</li>
	<li><?php
	echo $html->link(__('Coaches', true), array ('controller' => 'coaches','action' => 'index'));
	?></li>
	<li><?php
	echo $html->link(__('Teams', true), array ('controller' => 'teams','action' => 'index'));
	?>
	<ul>
		<li><?php
		echo $html->link(__('Statistics', true), array ('controller' => 'teams','action' => 'index'));
		?></li>
		<li><?php
		echo $html->link(__('Season Statistics', true), array ('controller' => 'teams','action' => 'index'));
		?></li>
	</ul>
	</li>
	<li><?php
	echo $html->link(__('Players', true), array ('controller' => 'players','action' => 'index'));
	?>
		<ul>
		<li><?php
		echo $html->link(__('Statistics', true), array ('controller' => 'statisticsPlayers','action' => 'index'));
		?></li>
		<li><?php
		echo $html->link(__('Season Statistics', true), array ('controller' => 'statisticsSeasonPlayers','action' => 'index'));
		?></li>
	</ul>
	</li>
	<li><?php
	echo $html->link(__('Championships', true), array ('controller' => 'championships','action' => 'index'));
	?>
	<ul>
		<li><?php
		echo $html->link(__('New', true), array ('controller' => 'championships','action' => 'add'));
		?></li>
		<li><?php
		echo $html->link(__('Calendars', true), array ('controller' => 'calendars','action' => 'index'));
		?></li>
		<li><?php
		echo $html->link(__('Ranking', true), array ('controller' => 'teamRankings','action' => 'index'));
		?></li>
		<li><?php
		echo $html->link(__('Import Match Report', true), array ('controller' => 'calendars','action' => 'upload'));
		?></li>
	</ul>
	</li>
	<li><a href="" target="_self" >Admin</a>
	<ul>
		<li><?php
		echo $html->link(__('Users', true), array ('controller' => 'users','action' => 'index'));
		?></li>
		<li><?php
		echo $html->link(__('Groups', true), array ('controller' => 'groups','action' => 'index'));
		?></li>
	</ul>
	</li>
</ul>
</div>

			<?php echo $this->Session->flash(); ?>

			<?php echo $content_for_layout; ?>

		</div>
		<div id="footer">
			<?php echo $this->Html->link(
					$this->Html->image('cake.power.gif', array('alt'=> __('CakePHP: the rapid development php framework', true), 'border' => '0')),
					'http://www.cakephp.org/',
					array('target' => '_blank', 'escape' => false)
				);
			?>
		</div>
	</div>
	<?php echo $this->element('sql_dump'); ?>
</body>
</html>